package com.ruoyi.basebill.mapper.task;

import com.ruoyi.basedata.domain.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 单据下发通用方法类
 */
@Repository
public interface OmsTaskUtilMapper {
    public String getNewNumber(@Param("date")String date, @Param("tableName")String tableName);

    public String getSaleNewNumber(@Param("date")String date);

    public BigDecimal getSettlementPrice(@Param("saleOrg")String SaleOrg, @Param("bizdate")Date bizdate,@Param("materia")String materia);

    public BigDecimal getSettlementRate3(@Param("saleOrg")String SaleOrg, @Param("bizdate")Date bizdate,@Param("customerNumber")String customerNumber, @Param("group3Number")String group3Number);

    public BigDecimal getSettlementRate2(@Param("saleOrg")String SaleOrg, @Param("bizdate")Date bizdate,@Param("customerNumber")String customerNumber, @Param("group2Number")String group2Number);

    public BigDecimal getSettlementRate1(@Param("saleOrg")String SaleOrg, @Param("bizdate")Date bizdate,@Param("customerNumber")String customerNumber, @Param("group1Number")String group1Number);

    /**
     * 根据销售组织、采入组织、业务日期、物料编码获取手动维护的数据
     *
     * @param saleOrg
     * @param bizdate
     * @param inOrg
     * @param materiaNumber
     * @return
     */
    OmsSettlementrateentry getSettlementRateByHand(@Param("saleOrg")String saleOrg, @Param("bizdate")Date bizdate, @Param("inOrg")String inOrg, @Param("materiaNumber")String materiaNumber);

    List<OmsSettlementrateentry> getSettlementRateByType(@Param("saleOrg")String saleOrg,@Param("bizdate")Date bizdate,@Param("inOrg")String inOrg,@Param("groupNumber")String groupNumber);


    OmsSettlementpriceentry getSettlementPriceByMaterialAndBizdate(@Param("materialNumber") String materialNumber,@Param("bizdate") Date date);


    BdPurprice getLastExpireDatePurprice(@Param("materialNumber") String materialNumber, @Param("bizdate") Date date);

    BdPurprice getPurpriceByBizDate(@Param("materialNumber") String materialNumber,@Param("bizdate") Date date);

    BdPurprice getPurpriceByLastExpireDate(@Param("materialNumber") String materialNumber);

    BdCheckoutprice getCheckoutprice(@Param("materialNumber") String materialNumber,@Param("customerTyperNumber")String customerTyperNumber,@Param("bizdate")Date bizdate);

    BdCheckoutprice getCheckoutpriceByLastExpireDate(@Param("materialNumber") String materialNumber,@Param("customerTyperNumber")String customerTyperNumber);


    ArrayList<tempTaxPrice> selectTempTaxPriceData();


    void updateTempTaxPrice(tempTaxPrice tempTaxPrice);


    List<Map> getRepeatReceBill(Date date);
    List<Map> getRepeatDeliverbill(Date date);
    List<Map> getRepeatSalereturnbill(Date date);
    List<Map> getRepeatTransferbill(Date date);


    void updateRepeatReceBill(@Param("code") String code,@Param("count") int count);

    void updateRepeatDeliverbill(@Param("code") String code,@Param("count") int count);

    void updateRepeatSalereturnbill(@Param("code") String code,@Param("count") int count);

    void updateRepeatTransferbill(@Param("code") String code,@Param("count") int count);

    List<String> selectRepeatBill(@Param("tableNumber") String tableNumber,@Param("date") Date date);


    /**
     * 删除对应的日志数据
     */
    void deleteOperLog(Date deleteDate);

    void deleteLoginLog(Date deleteDate);

    void deleteTaskLog(Date deleteDate);
}
